<?php session_start();
if (!isset($_SESSION["txt_login"]))
{ print "<script type = 'text/javascript'> location.href = 'index.php'</script>"; exit();}


header("Content-Type: text/html; charset=ISO-8859-1",true);

$ac = $_GET["ac"];
$id_vagas = $_GET["id_vagas"];

if($ac=="at"){
mysql_query("update vagas set ativo='S' where id_vagas = '$id_vagas' and id_cadastro_empresa = '".$_SESSION["id_cadastro_empresa"]."'");
}
if($ac=="des"){
mysql_query("update vagas set ativo='N' where id_vagas = '$id_vagas' and id_cadastro_empresa = '".$_SESSION["id_cadastro_empresa"]."'");
}
if($ac=="ex"){
mysql_query("delete from vagas where id_vagas = '$id_vagas' and id_cadastro_empresa = '".$_SESSION["id_cadastro_empresa"]."'");
}


?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<script type="text/javascript">
        var GB_ROOT_DIR = "./greybox/";
    </script>
     <script type="text/javascript" src="greybox/AJS.js"></script>
    <script type="text/javascript" src="greybox/gb_scripts_home.js"></script>
      <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
<div style="width:2050px; float:left; text-transform:capitalize; font-weight: bold; margin-bottom:20px; margin-top:10px; text-decoration:underline;" align="center">Lista de empresas</div>
<div style="width:2050px; height:100%; float:left; background-color: #FFFFFF;">
        <div style="width:2050px; float:left; text-transform:capitalize; font-weight: bold;">
          <div style="width:290px;float:left;border:1px solid #155E62;">Raz&atilde;o social</div>
          <div style="width:290px;float:left;border:1px solid #155E62;">n.fantasia</div>
          <div style="width:190px;float:left;border:1px solid #155E62;">Telefone</div>
          <div style="width:120px;float:left;border:1px solid #155E62;">data Cadastro</div>
          <div style="width:230px;float:left;border:1px solid #155E62;">Email</div>
          <div style="width:230px;float:left;border:1px solid #155E62;">Site</div>
           <div style="width:290px;float:left;border:1px solid #155E62;">Pessoa de Contato/tel Pessoa Contato</div>
          <div style="width:320px;float:left;border:1px solid #155E62;">Endere&ccedil;o</div>
   
        </div>
        <div style="width:2050px; height:100%; float:left;">
          <?php $sq_v = mysql_query("select * from cadastro_empresa");
		        while($linha=mysql_fetch_array($sq_v)){
			   extract($linha);
		  ?>
        
        
        <div style="width:290px; height:45px;float:left; border:1px solid #CCCCCC;"><?php echo $razao_social; ?></div>
        <div style="width:290px;height:45px;;float:left;border:1px solid #CCCCCC;"><?php echo $nome_fantasia; ?></div>
        <div style="width:190px;height:45px;float:left;border:1px solid #CCCCCC; text-decoration:none;">
        <?php echo $ddd_empresa." - ".$telefone_empresa; ?>
        </div>
        <div style="width:120px;height:45px;float:left;border:1px solid #CCCCCC;"><?php $da=explode("-",$data_cadastro);echo $da[2]."/".$da[1]."/".$da[0];?></div>
        <div style="width:230px;height:45px;float:left;border:1px solid #CCCCCC;"><?php echo $email; ?></div>
         <div style="width:230px;height:45px;float:left;border:1px solid #CCCCCC;"><?php echo $site; ?></div>
          <div style="width:290px;height:45px;float:left;border:1px solid #CCCCCC;"><?php echo $nome." / ".$telefone_comercial; ?></div>
        <div style="width:320px;height:45px;float:left;border:1px solid #CCCCCC;">
        <?php echo $endereco.", ".$numero.", ".$txt_id_cidade."/".$txt_id_estado."  - cep:".$cep; ?>
        </div>
       
        <?php }?>
  </div>
       
        </div>
        
        
        
        
        <script type="text/javascript">
GB_myShow = function(caption, url, /* optional */ height, width, callback_fn) {
    var options = {
        caption: caption,
        height: height || 1000,
        width: width || 800,
        fullscreen: false,
        show_loading: true,
        callback_fn: callback_fn
    }
    var win = new GB_Window(options);
    return win.show(url);
}
</script>